#ifndef GLOBAL_REFER_H
#define GLOBAL_REFER_H

#include <nav_msgs/Path.h>
#include <geometry_msgs/PoseStamped.h>
#include <eigen3/Eigen/Core>
#include <eigen3/Eigen/Eigen>
#include <eigen3/Eigen/Dense>
#include <iostream>
#include <fstream>
#include <string>
#include <ros/ros.h>
#include <glog/logging.h>
#include "glo_path_struct.h"
#include "fem_pos_dev_smo.h"
#include "global_smoother_parameters.h"

class Global_refer
{
public:
  Global_refer();
  ~Global_refer();
  void global_refer(Eigen::MatrixXd &hdmap_way_points);
  void Publish(Eigen::MatrixXd &hdmap_way_points_);
  void NormalizePoints(std::vector<std::pair<double, double>> *xy_points);
  void DeNormalizePoints(std::vector<std::pair<double, double>> *xy_points);
  void average_interpol(Eigen::MatrixXd &input, Eigen::MatrixXd &output, double interval_dis,
                             double distance);

private:
  Eigen::MatrixXd path_point_after_interpol;
  Eigen::MatrixXd hdmap_way_points;
  ros::Publisher refer_pub_;
  ros::NodeHandle private_nh;
  nav_msgs::Path referenceline;
  Eigen::MatrixXd way_point, rest_point;
  double zero_x_ = 0.0;
  double zero_y_ = 0.0;

  Global_Smoother_Parameters glo_smo_par;
};

#endif // GLOBAL_REFER_H
